package com.shelpe.services.sinbad.service.simbaproxy;

import java.util.Date;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

@FeignClient(name="${feign.simba.name}", url="${feign.simba.url}")
@RequestMapping(value = "/simba")
public interface CreativeClient {

	@RequestMapping(method =RequestMethod.GET, value = "/taobao.simba.creative.update")
	public CreativeRespDto postCreative(@RequestParam("adgroup_id") Long adgroupId, @RequestParam("creative_id") Long creativeId,
			@RequestParam("title") String title, @RequestParam("img_url") String url, @RequestParam("nick") String nick);
	
	@Data
	public static class CreativeDto{
		@JsonProperty("adgroup_id")
		private Long adgroupId;
		@JsonProperty("creative_id")
		private Long creativeId;
		private String title;
		private String nick;
		@JsonProperty("img_url")
		private String url;
	}
	
	/**
	 * nick
 creative_id
 title
 old_title
 img_url
 old_img_url
 audit_status
 audit_desc
 modify_time
 create_time
 modified_time
	 * @author beidou
	 *
	 */
	@Data
	public static class CreativeRespDto{
		private Long nick;
		@JsonProperty("creative_id")
		private Long creativeId;
		private String title;
		@JsonProperty("img_ur")
		private String imgUrl;
		@JsonProperty("old_title")
		private String oldtTitle;
		@JsonProperty("old_img_ur")
		private String oldimgUrl;
		@JsonProperty("audit_status")
		private String auditStatus;
		@JsonProperty("audit_desc")
		private String auditDesc;
		@JsonProperty("create_time")
	    private Date createTime;
		@JsonProperty("modify_time")
	    private Date modifiedTime;
		@JsonProperty("modifed_time")
	    private Date updatedTime;
	}
	
}
